﻿<%@ Page Title="Membership Registration  - Savory Housing" EnableEventValidation="false"
    Language="C#" MasterPageFile="~/RealState.Master" AutoEventWireup="true" CodeBehind="Membership.aspx.cs"
    Inherits="WebApplication.Membership" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="Scripts/Registration.js" type="text/javascript"></script>
    <script src="Scripts/Common.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%=ddlCity.ClientID%>').attr("disabled", true);
            $('#<%=ddlCountry.ClientID%>').change(getCity);
            $('#<%=ddlCountry.ClientID%>').change(getCountryCode);
            $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
            $(":input[title]").each(function () {
                $(this).val($(this).attr("title"));
                $(this).bind('focus', function () {
                    if ($(this).val() == $(this).attr("title")) $(this).val('');
                });
                $(this).bind('blur', function () {
                    if ($(this).val() == '') $(this).val($(this).attr("title"));

                });
            });

            $('#<%=txtPassword.ClientID %>').focusin(function () {
                $('#<%=txtPassword.ClientID %>')[0].type = "Password";
            });
            $('#<%=txtConfirmaPassword.ClientID %>').focusin(function () {
                $('#<%=txtConfirmaPassword.ClientID %>')[0].type = "Password";
            });

        });

        function getCity() {
            $('#<%=ddlCity.ClientID%>').attr("disabled", true);        
            $("select[id$=ddlCity] > option").remove();
            $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetCity",
                data: "{Country: '" + $('#MainContent_ddlCountry :selected').text() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {                   
                    var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;                   
                    for (var i = 0; i < models.length; i++) {
                        var val = models[i];
                        var text = models[i];
                        $('#MainContent_ddlCity').append(new Option(text, val, false));
                    }
                    $('#<%=ddlCity.ClientID%>').attr("disabled", false);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }

        function getCountryCode() {
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetCountryCode",
                data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var objectvalue = jQuery.parseJSON(response.d);
                    $('#MainContent_txtCountryCodes').val('00'+objectvalue);

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }
        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
     <asp:HiddenField ID="hdnAlertCounter" runat="server" />
    <div id="content_container">
        <!--left-->
        <div class="left">
            <div class="formBlock">
                <form method="post" action="#">
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                <h3 class="blue">
                    You Are?<br />
                </h3>
                <!-- <span>Fee Reuired</span> -->
             <%-- <div>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" CssClass="error" ErrorMessage="Confirm password is not same as Password"
                        ControlToValidate="txtConfirmaPassword" ControlToCompare="txtPassword"></asp:CompareValidator>
                    <asp:RequiredFieldValidator ID="reqtxtPassword" runat="server" CssClass="error" ControlToValidate="txtPassword"
                        InitialValue="Password" ErrorMessage="Please enter Password"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="compConfirmEmailID" runat="server" ErrorMessage="Email doesn't matched"
                        ControlToValidate="txtConfirmEmailID" CssClass="error" ControlToCompare="txtEmailID"></asp:CompareValidator>
                    <asp:RegularExpressionValidator ID="regtxtEmailID" ErrorMessage="Please enter valid Email ID"
                        runat="server" ValidationExpression="\w+([-+.&#039;]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        CssClass="error" ControlToValidate="txtEmailID"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="reqtxtContactNumber1" runat="server" CssClass="error"
                        InitialValue="Mobile[1]" ControlToValidate="txtContactNumber1" ErrorMessage="Please enter mobile number"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="reqddlCity" runat="server" CssClass="error" InitialValue="City"
                        ControlToValidate="ddlCity" ErrorMessage="Please select City"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="error"
                        InitialValue="Country" ControlToValidate="ddlCountry" ErrorMessage="Please select country"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="reqtxtLastName" runat="server" CssClass="error" InitialValue="Last Name"
                        ControlToValidate="txtLastName" ErrorMessage="Please enter last name"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="reqtxtFirstName" runat="server" CssClass="error"
                        InitialValue="First Name" ControlToValidate="txtFirstName" ErrorMessage="Please enter first name"></asp:RequiredFieldValidator>
                </div>--%>
                <dl class="form clearfix">
                    <dt>
                        <asp:RadioButtonList ID="rdoOption" runat="server" TabIndex="1" RepeatDirection="Vertical">
                            <asp:ListItem Text="Real Estate Agent/Office" Selected="True" Value="1" />
                            <asp:ListItem Text="Company (Eng., Material Procurement, Construction, etc)" Value="2" />
                            <asp:ListItem Text="Private" Value="3" />
                        </asp:RadioButtonList>
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtFirstName" runat="server" CssClass="form-text" title="First Name"
                            TabIndex="2" MaxLength="200"></asp:TextBox>
                        <%--<input type="text" class="form-text" value="First Name" />--%>
                        <span class="red">*</span> </dt>
                    <dt>
                        <asp:TextBox ID="txtLastName" runat="server" CssClass="form-text" title="Last Name"
                            TabIndex="3" MaxLength="100"></asp:TextBox>
                        <%--<input type="text" class="form-text" value="Last Name" />
                        --%><span class="red">*</span> </dt>
                    <dt>
                        <asp:TextBox ID="txtOfficeName" runat="server" CssClass="form-text" title="Office/Company Full Name"
                            TabIndex="4" MaxLength="200"></asp:TextBox>
                        <%-- <input type="text" class="form-text" value="Office/Company Full Name" />--%>
                    </dt>
                    <dt>
                        <asp:DropDownList ID="ddlCountry" CssClass="form-text" runat="server" TabIndex="5">
                        </asp:DropDownList>
                        <span class="red">*</span> 
                    </dt>
                    <dt>
                        <asp:DropDownList ID="ddlCity" CssClass="form-text" runat="server" TabIndex="6">
                        </asp:DropDownList>
                        <span class="red">*</span> 
                        <br />
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtStreet" runat="server" CssClass="form-text" title="Street" MaxLength="200"
                            TabIndex="7"></asp:TextBox>
                        <%--<input type="text" class="form-text" value="Street" />--%>
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtCountryCodes" CssClass="form-text" title="Country Code" MaxLength="100"
                            runat="server" TabIndex="8" ReadOnly="true" />
                        <%--<input type="text" class="form-text" value="Country Code" />--%>
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtContactNumber1" CssClass="form-text" title="Mobile[1]" MaxLength="100"
                            runat="server" TabIndex="9" />
                        <span class="red">*</span> </dt>
                    <dt>
                        <asp:TextBox ID="txtContactNumber2" CssClass="form-text" title="Mobile[2]" MaxLength="100"
                            runat="server" TabIndex="10" />
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtPhone1" CssClass="form-text" title="Phone [1]" MaxLength="100"
                            runat="server" TabIndex="11" />
                        <%--<input type="text" class="form-text" value="Phone [1]" />
                        --%>
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtPhone2" CssClass="form-text" title="Phone [2]" MaxLength="100"
                            runat="server" TabIndex="12" />
                        <%--        <input type="text" class="form-text" value="Phone [2]" />
                        --%>
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtFax" CssClass="form-text" title="Fax" MaxLength="100" runat="server"
                            TabIndex="13" />
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtWebsite" CssClass="form-text" title="Website" MaxLength="100"
                            runat="server" TabIndex="14" />
                    </dt>
                    <dt>
                        <asp:TextBox ID="txtEmailID" CssClass="form-text" title="Your Email" MaxLength="200"
                            runat="server" TabIndex="15" />
                        <%--<input type="text" class="form-text" value="Your Email" />
                        --%><span class="red">*</span> </dt>
                    <dt>
                        <asp:TextBox ID="txtConfirmEmailID" CssClass="form-text" title="Confirm Email" MaxLength="200"
                            runat="server" TabIndex="16" />
                        <%--        <input type="text" class="form-text" value="Confirm Email" />
                        --%>
                        <span class="red">*</span> </dt>
                    <dt>
                        <asp:TextBox ID="txtPassword" CssClass="form-text" MaxLength="20" runat="server"
                            TabIndex="18" title="Password" />
                        <span class="red">*</span> </dt>
                    <dt>
                        <asp:TextBox ID="txtConfirmaPassword" CssClass="form-text" MaxLength="20" runat="server"
                            TabIndex="19" title="Confirm Password" />
                        <span class="red">*</span> </dt>
                    <dt>
                        <br />
                        <br />
                        <label>
                            <asp:CheckBox ID="chkNewsLatter" runat="server" TabIndex="20" />
                            <span class="blue">Send me Special Offers, Events and News-Letters.</span></label>
                        <br />
                        <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"
                            class="lnk_purple"><strong>Why do you need to provide this information?</strong></a></dt>
                    <div id="light" class="popup_content" style="display: none;">
                        <div class="popup_container">
                            <div class="popup_msg">
                                <h2>
                                    Why do you need to provide this information?</h2>
                                <p>
                                    Aug 9, 2012 - Rather than using a bloated plugin that has features you'll never
                                    use, this tutorial shows you how to create a super simple lightbox for handling
                                    ... You visited this page on 20/7/13.</p>
                                <ul>
                                    <li>In this example everything is static</li>
                                    <li>Hope you will find it useful, should you use</li>
                                    <li>Template Monster offers you a great assortment of CSS Templates</li>
                                </ul>
                            </div>
                            <div class="popup_ok">
                                <input type="button" value="Ok, I got it" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'" /></div>
                        </div>
                    </div>
                    <dt>
                        <br />
                        <asp:Button ID="btnSubmit" runat="server" CssClass="reg-blue-round-btn w75" TabIndex="21"
                            OnClick="btnSubmit_Click" Text="Continue" />
                        <asp:Label ID="lblMessage" Visible="false" runat="server" />
                        <div id="divLoadingImage" style="display: none;" class="ajax_loader">
                            <asp:Image ID="img1" runat="server" ImageUrl="~/images/ajax_loader.gif"
                                alt="loader" title="loader" />
                        </div>
                        <%--<input type="button" value="Continue" class="reg-blue-round-btn w75" onclick="parent.location='Membership-Step2.aspx'" />--%>
                    </dt>
                </dl>
                </form>
            </div>
        </div>
        <!--left-->
        <div class="clear">
        </div>
    </div>
    </div>
</asp:Content>
